{php include wl_template('common/header');}
<!--<span class="price" style="display:none;">0.01</span>-->

<ul class="nav nav-tabs" >
	

	<li {if $op == 'display'}class="active"{/if}><a href="{php echo web_url('store/notice', array('op' => 'display'))}">模板消息</a></li>

	<!--<li class="ex-button"><a class="ex-b-lastA" target="_blank" href="http://doc.lexiangpingou.cn/modalMessage.html">图文说明</a></li>-->
</ul>
{if $op == 'base'}
	
	<div class="panel panel-default">
	<div class="panel-body table-responsive" style="padding: 0px;">
		<div class="main_bd">
        <div class="plugins_wrp">
            <dl>
                <dd>
                    <ul id="js_plugins">
						<li class="item_wrp" style="width: 100%;">
							<div class="plugin_item">
								<div  id="link-icon1" class="plugin_icon" >
									<div id="link-icon" style="display:none;width:100%;height:100%;position:absolute;background-color:rgba(0,0,0,0.3);cursor:pointer;">
										<img src="{TG_URL_WRES}images/3.svg"style="position:absolute;width:60%;left:20%;">
									</div>
									<img src="{TG_URL_WRES}images/function/panelmessage.png" style="cursor:pointer;">
								</div>
								
								<div class="plugin_status">
									<i class="access"></i>
									<span class="status_txt">
										{if $checkfunction['status']}	
											
										<div id="renewal" style="font-size:20px;margin-top:-30px;width: 60px;height:60px;border-radius:50%;font-weight:900;background-color:#ff5466;color:white;margin-right: -25px;text-align:center;line-height:60px;cursor:pointer;">续费</div>										
								
										<span style="display:block;margin-left:-70px;color:#888;font-size:14px;">截止日期：{php echo date('Y-m-d', $checkfunction['endtime'])}</span>
										
										{else}
										
										<div id="buyDaifu" style="font-size:20px;margin-top:-20px;width: 60px;height:60px;border-radius:50%;font-weight:900;background-color:#ff5466;color:white;margin-right: -25px;text-align:center;line-height:60px;cursor:pointer;">购买</div>
										{/if}
									</span>
								</div>
								<div class="plugin_content">
									<h3 class="title">{$_W['page']['title']}</h3>
									<p class="desc" style="    width: 100%;">
										启用模板消息功能后，能自动给粉丝推送各种订单状态等通知。
										
									</p>
								</div>
							</div>
						</li>
					</ul>
                </dd>
            </dl>
        </div>
    </div>
	</div>
</div>
{else}
<div class="main">
	<form action="" method="post" class="form-horizontal form" id="setting-form">
		<div class="panel panel-default">
		
			<div class="panel-body">
				
					
						<div class="form-group">
							<label class="col-md-2 control-label">模板消息配置说明</label>
							<div class="col-md-8">
								<div class="alert alert-warning">
									<h5 style="text-indent: 18px;">注: 只有 <b>认证服务号</b> 添加消息模板后才可以使用模板消息功能。</h5>
									<ol>
										<li>登陆<a href="https://mp.weixin.qq.com/">【微信公众平台】</a>-【功能】-【模板消息】</li>
										<li>主行业选择为：“IT科技 - 互联网|电子商务”</li>
										<li>副行业选择为：“消费品 - 消费品”</li>
										<li>在【模板库】搜索对应模板标题找到对应模板,点击详情保存添加,重复执行。</li>
										<li>把【我的模板】下对应标题复制模板ID到本页设置对应位置。</li>
									</ol>
								</div>
							</div>
						</div>
				
						<div class="panel panel-warning" style="display: none">
							<div class="panel-heading">支付成功模板参数设置</div>
							<div class="panel-body">
								<div class="form-group">
									<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">支付成功模板ID</label>
									<div class="col-xs-12 col-sm-8">
										<input type="text" name="m_pay" class="form-control" value="{$settings['m_pay']}" />
										<span class="help-block">公众平台模板消息编号：IT科技——互联网|电子商务——OPENTM407642952   支付成功提醒</span>
									</div>
								</div>
								<div class="form-group">
							<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">代付成功模板ID</label>
							<div class="col-xs-12 col-sm-8">
								<input type="text" name="m_daipay" class="form-control" value="{$settings['m_daipay']}" />
								<span class="help-block">公众平台模板消息编号：IT科技——互联网|电子商务——OPENTM200561396  订单代付成功通知</span>
							</div>
						</div>
							</div>
						</div>
						<div class="panel panel-success" style="display: none">
							<div class="panel-heading">组团成功模板参数设置</div>
							<div class="panel-body">
								<div class="form-group">
									<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">模板ID</label>
									<div class="col-xs-12 col-sm-8">
										<input type="text" name="m_tuan" class="form-control" value="{$settings['m_tuan']}" />
										<span class="help-block">公众平台模板消息编号：消费品 - 消费品——OPENTM407500299  拼团结果通知</span>
									</div>
								</div>
								
								
							</div>
						</div>
						
						
						<div class="panel panel-default" style="display: none">
							<div class="panel-heading">未支付订单模板参数设置</div>
							<div class="panel-body">
								<div class="form-group">
									<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">模板ID</label>
									<div class="col-xs-12 col-sm-8">
										<input type="text" name="m_nocash" class="form-control" value="{$settings['m_nocash']}" />
										<span class="help-block">公众平台模板消息编号：IT科技 - 互联网|电子商务——TM00470未支付提醒通知</span>
									</div>
								</div>
							
							</div>
						</div>
						<div class="panel panel-info" style="display: none">
							<div class="panel-heading">发货模板参数设置</div>
							<div class="panel-body">
								<div class="form-group">
									<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">模板ID</label>
									<div class="col-xs-12 col-sm-8">
										<input type="text" name="m_send" class="form-control" value="{$settings['m_send']}" />
										<span class="help-block">公众平台模板消息编号：IT科技——互联网|电子商务——OPENTM200565259订单发货提醒 </span>
									</div>
								</div>
															
							</div>
						</div>
						<!--<div class="panel panel-info">
							<div class="panel-heading">核销模板参数设置</div>
							<div class="panel-body">
								<div class="form-group">
									<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">模板ID</label>
									<div class="col-xs-12 col-sm-8">
										<input type="text" name="m_hexiao" class="form-control" value="{$settings['m_hexiao']}" />
										<span class="help-block">公众平台模板消息编号：消费品 - 消费品——OPENTM206215005核销成功提醒 </span>
									</div>
								</div>
																
							</div>
						</div>-->
						<div class="panel panel-danger" >
							<div class="panel-heading">退款模板参数设置</div>
							<div class="panel-body">
								<div class="form-group">
									<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">模板ID</label>
									<div class="col-xs-12 col-sm-8">
										<input type="text" name="m_ref" class="form-control" value="{$settings['m_ref']}" />
										<span class="help-block">公众平台模板消息编号：IT科技——互联网|电子商务——OPENTM207762668退单通知</span>
									</div>
								</div>
								
								
							</div>
						</div> 
						<div class="panel panel-info">
							<div class="panel-heading">支付模板参数设置</div>
							<div class="panel-body">
								<div class="form-group">
									<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">模板ID</label>
									<div class="col-xs-12 col-sm-8">
										<input type="text" name="m_buy" class="form-control" value="{$settings['m_buy']}" />
										<span class="help-block">公众平台模板消息编号：IT科技——互联网|电子商务——OPENTM207444643商品购买成功通知</span>
									</div>
								</div>							
							</div>
						</div>
						<div class="panel panel-info" style="display: none">
							<div class="panel-heading">降价或上架消息提醒模板参数设置</div>
							<div class="panel-body">
								<div class="form-group">
									<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">模板ID</label>
									<div class="col-xs-12 col-sm-8">
										<input type="text" name="m_change" class="form-control" value="{$settings['m_change']}" />
										<span class="help-block">公众平台模板消息编号：IT科技——互联网|电子商务——OPENTM202288716产品变更提醒</span>
									</div>
								</div>							
							</div>
						</div>
				<div class="panel panel-info" style="display: none">
					<div class="panel-heading">补款通知</div>
					<div class="panel-body">
						<div class="form-group">
							<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">模板ID</label>
							<div class="col-xs-12 col-sm-8">
								<input type="text" name="m_bukuan" class="form-control" value="{$settings['m_bukuan']}" />
								<span class="help-block">公众平台模板消息编号：IT科技——互联网|电子商务——OPENTM402027405补款通知</span>
							</div>
						</div>
					</div>
				</div>
				<div class="panel panel-info" style="display: none">
					<div class="panel-heading">参团人数不足通知</div>
					<div class="panel-body">
						<div class="form-group">
							<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">模板ID</label>
							<div class="col-xs-12 col-sm-8">
								<input type="text" name="m_no_num_success" class="form-control" value="{$settings['m_no_num_success']}" />
								<span class="help-block">公众平台模板消息编号：IT科技——互联网|电子商务——OPENTM406281958参团人数不足</span>
							</div>
						</div>
					</div>
				</div>
				<div class="panel panel-info">
					<div class="panel-heading">任务处理通知</div>
					<div class="panel-body">
						<div class="form-group">
							<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">模板ID</label>
							<div class="col-xs-12 col-sm-8">
								<input type="text" name="m_result" class="form-control" value="{$settings['m_result']}" />
								<span class="help-block">公众平台模板消息编号：IT科技——互联网|电子商务——OPENTM200605630任务处理通知</span>
							</div>
						</div>
					</div>
				</div>
						<!--<div class="panel panel-default">
							<div class="panel-heading">客服处理模板参数设置</div>
							<div class="panel-body">
								<div class="form-group">
									<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">模板ID</label>
									<div class="col-xs-12 col-sm-8">
										<input type="text" name="m_feedback" class="form-control" value="{$settings['m_feedback']}" />
										<span class="help-block">公众平台模板消息编号：IT科技——互联网|电子商务——OPENTM202172872客服处理提醒 </span>
									</div>
								</div>							
							</div>
						</div>
						<div class="panel panel-danger">
							<div class="panel-heading">售后申请模板参数设置</div>
							<div class="panel-body">
								<div class="form-group">
									<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">模板ID</label>
									<div class="col-xs-12 col-sm-8">
										<input type="text" name="m_service" class="form-control" value="{$settings['m_service']}" />
										<span class="help-block">公众平台模板消息编号：IT科技——互联网|电子商务——OPENTM207778718售后申请通知 </span>
									</div>
									
						
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
                    <div class="col-xs-12 col-sm-8" style="margin-left:180px;">
                      

                        <div class='input-group'>
                            <input type="text" id='salers' name="salers" maxlength="30" value="{$settings['salers']}" class="form-control" readonly />
							<input type="hidden" id='saleropenid' name="saleropenid" maxlength="30" value="{$settings['saleropenid']}" class="form-control" readonly />
                            <div class='input-group-btn'>
                                <button class="btn btn-default" type="button" onclick="popwin = $('#modal-module-menus').modal();">选择通知人</button>
                            </div>
                        </div>
                        <div class="input-group multi-img-details" id='saler_container'>
                            
                        </div>
                        <span class='help-block'>提交售后申请后商家通知，如果不填写则不通知</span>
                        <div id="modal-module-menus"  class="modal fade" tabindex="-1">
                            <div class="modal-dialog" style='width: 920px;'>
                                <div class="modal-content">
                                    <div class="modal-header"><button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button><h3>选择通知人</h3></div>
                                    <div class="modal-body" >
                                        <div class="row">
                                            <div class="input-group">
                                                <input type="text" class="form-control" name="keyword" value="" id="search-kwd" placeholder="请输入粉丝昵称/姓名/手机号" />
                                                <span class='input-group-btn'><button type="button" class="btn btn-default" onclick="search_members();">搜索</button></span>
                                            </div>
                                        </div>
                                        <div id="module-menus" style="padding-top:5px;"></div>
                                    </div>
                                    <div class="modal-footer"><a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</a></div>
                                </div>

                            </div>
                        </div>
                       
                    </div>
               
						 
								</div>							
							</div>
						</div>
					-->
						
						
				
			</div>
		</div>
	
	
		<div class="form-group col-sm-12">
			<input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" />
			<input type="hidden" name="token" value="{$_W['token']}" />
		</div>
	</form>
</div>
	{/if}	


<script language='javascript'>
		var linkicon=document.getElementById("link-icon");
		var linkicon2=document.getElementById("link-icon1");
		
		linkicon2.onmouseleave = function () {
			linkicon.style.setProperty( 'display', 'none' );
		}
		
		linkicon2.onmouseover = function () {
			linkicon.style.setProperty( 'display', 'block' );
		}
		
		linkicon.onclick=function (ev) {
			document.getElementById('detailimg').src='{TG_URL_WRES}images/function/mbxx.jpg';
			document.getElementById("detailshow").style.setProperty("display","block");
		}
                function search_members() {
                    if ($.trim($('#search-kwd').val()) == '') {
                        Tip.focus('#search-kwd', '请输入关键词');
                        return;
                    }
                    $("#module-menus").html("正在搜索....");
                    $.get('{php echo web_url('store/query')}', { 
                        keyword: $.trim($('#search-kwd').val())
                    }, function (dat) {
                        $('#module-menus').html(dat);
                    });
                }
                function select_member(o) {

                    if ($('.multi-item[openid="' + o.openid + '"]').length > 0) {
                        return;
                    }
                    var html = '<div class="multi-item" openid="' + o.openid + '">';
                    html += '<img class="img-responsive img-thumbnail" src="' + o.avatar + '" onerror="this.src=\'./resource/images/nopic.jpg\'; this.title=\'图片未找到.\'"  style="width:100px;">';
                    html += '<div class="img-nickname" style="display:none;">' + o.nickname + '</div>';
					html += '<div class="img-openid" style="display:none;">' + o.from_user + '</div>';
                    html += '<input type="hidden" value="' + o.openid + '" name="openids[]">';
                    html += '<em onclick="remove_member(this)"  class="close">×</em>';
                    html += '</div>';
                    $("#saler_container").append(html);
                    refresh_members();
                }

                function remove_member(obj) {
                    $(obj).parent().remove();
                    refresh_members();
                }
                function refresh_members() {
					var openid="";
                    var nickname = "";
                    $('.multi-item').each(function () {
                        nickname += " " + $(this).find('.img-nickname').html() + "; ";
						 openid += "" + $(this).find('.img-openid').html() + "";
                    });
                    $('#salers').val(nickname);
					 $('#saleropenid').val(openid);
                }

            </script>

{php include wl_template('common/footer');}late('common/footer');}